package br.ufc.great.dtxtester;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.Vector;

import javax.swing.DefaultListModel;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;

import br.ufc.great.dtxtester.config.Config;
import br.ufc.great.dtxtester.config.ConfigSite;
import br.ufc.great.dtxtester.operation.InsertOperation;
import br.ufc.great.dtxtester.operation.InsertOperations;
import br.ufc.great.dtxtester.operation.QueryOperation;
import br.ufc.great.dtxtester.operation.QueryOperations;

/**
 * 
 * @author Leonardo Oliveira Moreira
 *
 */
public class CreateExperimentDialog extends javax.swing.JDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 456768752535531352L;
	
	private Config configuration;
	private int transactionId = 0;
	private DTXTester dtxTester;
	
	private JPanel leftPanel, rightPanel;

    public CreateExperimentDialog(DTXTester dtxTester) {
        initComponents();
        this.dtxTester = dtxTester;
    }
    
    private void initComponents() {
        jlSite = new javax.swing.JLabel();
        jlSites = new javax.swing.JList(new DefaultListModel());
        jlNumberClients = new javax.swing.JLabel();
        jtfNumberClients = new javax.swing.JTextField();
        jlNumberTransactions = new javax.swing.JLabel();
        jtfNumberTransactions = new javax.swing.JTextField();
        jlNumberOperations = new javax.swing.JLabel();
        jtfNumberOperations = new javax.swing.JTextField();
        jlUpdateOperations = new javax.swing.JLabel();
        jlUpdateTransactions = new javax.swing.JLabel();
        jtfUpdateTransactions = new javax.swing.JTextField();
        jtfUpdateOperations = new javax.swing.JTextField();
        jlPercentUT = new javax.swing.JLabel();
        jlPercentUO = new javax.swing.JLabel();
        jlExtension = new javax.swing.JLabel();
        jlTransactionsInterval = new javax.swing.JLabel();
        jtfTransactionsInterval = new javax.swing.JTextField();
        jbCreate = new javax.swing.JButton();
        
        leftPanel = new JPanel(null);
        rightPanel = new JPanel(null);
        
        configuration = new Config();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setModal(true);
        setTitle("Create experiment");
        setName("jdCreateExperiment");
        setResizable(false);
        setLayout(new GridLayout(1, 2));

        jlSite.setText("Site:");

        jbCreate.setText("Create experiment");
        jlNumberClients.setText("Number of clients:");
        jlNumberTransactions.setText("Number of transactions:");
        jlNumberOperations.setText("Number of operations:");
        jlUpdateOperations.setText("Update operations:");
        jlUpdateTransactions.setText("Update transactions:");
        jlTransactionsInterval.setText("Delay between transactions:");
        jlPercentUT.setText("%");
        jlPercentUO.setText("%");
        jlExtension.setText("ms");

    	jtfNumberClients.setText("0");
    	jtfNumberTransactions.setText("0");
    	jtfUpdateTransactions.setText("0");
    	jtfNumberOperations.setText("0");        	
    	jtfUpdateOperations.setText("0");
    	jtfTransactionsInterval.setText("0");

        jbCreate.setEnabled(false);

        jlSite.setBounds(10, 10, 50, 20);
        jspSites = new JScrollPane(jlSites);
        jspSites.setBounds(10, 55, 205, 120);
        
        jlNumberClients.setBounds(10, 35, 120, 20);
        jlNumberTransactions.setBounds(10, 60, 120, 20);
        jlUpdateTransactions.setBounds(10, 85, 120, 20);
        jlPercentUT.setBounds(215, 85, 120, 20);
        jlNumberOperations.setBounds(10, 110, 120, 20);
        jlUpdateOperations.setBounds(10, 135, 120, 20);
        jlPercentUO.setBounds(215, 135, 120, 20);
        jlTransactionsInterval.setBounds(10, 160, 140, 20);
        jlExtension.setBounds(215, 160, 120, 20);
        
        jtfNumberClients.setBounds(150, 35, 75, 20);
        jtfNumberTransactions.setBounds(150, 60, 75, 20);
        jtfUpdateTransactions.setBounds(150, 85, 60, 20);
        jtfNumberOperations.setBounds(150, 110, 75, 20);
        jtfUpdateOperations.setBounds(150, 135, 60, 20);
        jtfTransactionsInterval.setBounds(150, 160, 60, 20);
        
        jbCreate.setBounds(10, 185, 220, 25);
        
        leftPanel.add(jlSite);
        leftPanel.add(jspSites);
        
        rightPanel.add(jlNumberClients);
        rightPanel.add(jlNumberTransactions);
        rightPanel.add(jlUpdateTransactions);
        rightPanel.add(jlPercentUT);
        rightPanel.add(jlNumberOperations);
        rightPanel.add(jlUpdateOperations);
        rightPanel.add(jlPercentUO);
        rightPanel.add(jlTransactionsInterval);
        rightPanel.add(jlExtension);
        
        rightPanel.add(jtfNumberClients);
        rightPanel.add(jtfNumberTransactions);
        rightPanel.add(jtfUpdateTransactions);
        rightPanel.add(jtfNumberOperations);
        rightPanel.add(jtfUpdateOperations);
        rightPanel.add(jtfTransactionsInterval);
        
        rightPanel.add(jbCreate);
        
        add(leftPanel);
        add(rightPanel);

		try {
	        Catalog catalog = new Catalog("catalog.xml");
	        Vector<Site> sites = catalog.getSites();
	    	DefaultListModel listModel = (DefaultListModel) jlSites.getModel();
	        for (int i = 0; sites != null && i < sites.size(); i++)
	            configuration.addSite(sites.elementAt(i).getHost(), sites.elementAt(i).getPort());
	        if (sites != null && sites.size() > 0) {
	        	refreshSites();
	        	jlSites.setSelectedIndex(listModel.getSize() - 1);
	        }
		}
		catch (IOException e) {
			e.printStackTrace();
		}
        
        jtfNumberClients.addKeyListener(new KeyAdapter() {
        	public void keyPressed(KeyEvent e) {
        		if (e.getKeyCode() == 10)
        			jtfNumberClients.transferFocus();
        	}
        });

        jtfNumberClients.addFocusListener(new FocusAdapter() {
        	public void focusGained(FocusEvent e) {
        		((JTextField) e.getSource()).selectAll();
        	}
        });

        jtfNumberTransactions.addKeyListener(new KeyAdapter() {
        	public void keyPressed(KeyEvent e) {
        		if (e.getKeyCode() == 10)
        			jtfNumberTransactions.transferFocus();
        	}
        });

        jtfNumberTransactions.addFocusListener(new FocusAdapter() {
        	public void focusGained(FocusEvent e) {
        		((JTextField) e.getSource()).selectAll();
        	}
        });

        jtfUpdateTransactions.addKeyListener(new KeyAdapter() {
        	public void keyPressed(KeyEvent e) {
        		if (e.getKeyCode() == 10)
        			jtfUpdateTransactions.transferFocus();
        	}
        });

        jtfUpdateTransactions.addFocusListener(new FocusAdapter() {
        	public void focusGained(FocusEvent e) {
        		((JTextField) e.getSource()).selectAll();
        	}
        });

        jtfNumberOperations.addKeyListener(new KeyAdapter() {
        	public void keyPressed(KeyEvent e) {
        		if (e.getKeyCode() == 10)
        			jtfNumberOperations.transferFocus();
        	}
        });

        jtfNumberOperations.addFocusListener(new FocusAdapter() {
        	public void focusGained(FocusEvent e) {
        		((JTextField) e.getSource()).selectAll();
        	}
        });

        jtfUpdateOperations.addKeyListener(new KeyAdapter() {
        	public void keyPressed(KeyEvent e) {
        		if (e.getKeyCode() == 10)
        			jtfUpdateOperations.transferFocus();
        	}
        });
        
        jtfUpdateOperations.addFocusListener(new FocusAdapter() {
        	public void focusGained(FocusEvent e) {
        		((JTextField) e.getSource()).selectAll();
        	}
        });

        jtfTransactionsInterval.addKeyListener(new KeyAdapter() {
        	public void keyPressed(KeyEvent e) {
        		if (e.getKeyCode() == 10)
        			jtfTransactionsInterval.transferFocus();
        	}
        });
        
        jtfTransactionsInterval.addFocusListener(new FocusAdapter() {
        	public void focusGained(FocusEvent e) {
        		((JTextField) e.getSource()).selectAll();
        	}
        });

        jbCreate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbCreateActionPerformed(evt);
            }
        });

        pack();
        setSize(480, 250);
        Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((dimension.width - getSize().width) / 2, (dimension.height - getSize().height) / 2);
    }
    
    private void jbCreateActionPerformed(java.awt.event.ActionEvent evt) {
    	DefaultListModel listModel = (DefaultListModel) jlSites.getModel();
    	if (listModel.getSize() == 0)
    		return;
    	try {
    		Catalog catalog = new Catalog("catalog.xml");
        	Vector<Site> sites = catalog.getSites();

    		QueryOperations queryOperations = new QueryOperations("query-operations.xml");
			InsertOperations insertOperations = new InsertOperations("insert-operations.xml");
			int numberClients = Integer.parseInt(jtfNumberClients.getText());
			int percentUpdateTransactions = Integer.parseInt(jtfUpdateTransactions.getText());
			int numberTransactions = Integer.parseInt(jtfNumberTransactions.getText());
			int numberUpdateTransactions = (percentUpdateTransactions * numberTransactions) / 100;
			int numberReadTransactions = numberTransactions - numberUpdateTransactions;
			int numberOperations = Integer.parseInt(jtfNumberOperations.getText());
			int percentUpdateOperations = Integer.parseInt(jtfUpdateOperations.getText());
			int numberUpdateOperations = (percentUpdateOperations * numberOperations) / 100;
    		int numberReadOperations = numberOperations - numberUpdateOperations;
    		long transactionsInterval = Long.parseLong(jtfTransactionsInterval.getText());
			String strResult = "";
			strResult += "<!--\n";
			strResult += "Experiment parameters\n";
			strResult += "Number of sites: " + sites.size() + "\n";
			strResult += "Number of clients: " + numberClients + "\n";
			strResult += "Number of transactions by client: " + numberTransactions + "\n";
			strResult += "Number of read transactions by client: " + numberReadTransactions + " - " + (100 - percentUpdateTransactions) + "%" + "\n";
			strResult += "Number of update transactions by client: " + numberUpdateTransactions + " - " + percentUpdateTransactions + "%" + "\n";
			strResult += "Number of operations by transaction: " + numberOperations + "\n";
			strResult += "Number of read operations by transaction: " + numberReadOperations + " - " + (100 - percentUpdateOperations) + "%" + "\n";
			strResult += "Number of update operations by transaction: " + numberUpdateOperations + " - " + percentUpdateOperations + "%" + "\n";
			strResult += "Delay between transactions: " + transactionsInterval + " ms" + "\n";
			strResult += "-->\n";
			strResult += "<experiment>\n";
			strResult += "    <parameters>\n";
			strResult += "        <sites>" + sites.size() + "</sites>\n";
			strResult += "        <clients>" + numberClients + "</clients>\n";
			strResult += "        <transactions number=\"" + numberTransactions + "\" delayBetweenTransactions=\"" + transactionsInterval + "\">\n";
			strResult += "            <readTransactions number=\"" + numberReadTransactions + "\" percent=\"" + (100 - percentUpdateTransactions) + "\" />\n";
			strResult += "            <updateTransactions number=\"" + numberUpdateTransactions + "\" percent=\"" + percentUpdateTransactions + "\" />\n";
			strResult += "        </transactions>\n";
			strResult += "        <operations number=\"" + numberOperations + "\">\n";
			strResult += "            <readOperations number=\"" + numberReadOperations + "\" percent=\"" + (100 - percentUpdateOperations) + "\" />\n";
			strResult += "            <updateOperations number=\"" + numberUpdateOperations + "\" percent=\"" + percentUpdateOperations + "\" />\n";
			strResult += "        </operations>\n";			
			strResult += "    </parameters>\n";
			strResult += "    <sites>\n";
			for (int i = 0; i < sites.size(); i++) {
				Site configSite = sites.elementAt(i);
				strResult += "        <site id=\"" + configSite.getId() + "\" host=\"" + configSite.getHost() + "\" port=\"" + configSite.getPort() + "\" />\n";
			}
			strResult += "    </sites>\n";
			strResult += "    <clients>\n";
			for (int c = 0, s = 0; c < numberClients; c++) {
				String siteId =  sites.elementAt(s).getId();
				String clientName = "c" + c + "@" + siteId;
				strResult += "        <client name=\"" + clientName + "\" site=\"" + siteId + "\" transactionsInterval=\"" + transactionsInterval + "\">\n";
				strResult += "            <transactions>\n";
	    		int readTransactions = 0;
	    		int updateTransactions = 0;
				while (readTransactions + updateTransactions < (numberReadTransactions + numberUpdateTransactions)) {
	    			if (System.currentTimeMillis() % 2 == 0) {
	    				// Prioridade das trasações de leitura
	    				if (readTransactions < numberReadTransactions) {
							String transactionId = clientName + "." + "t" + "." + "r" + readTransactions + "_" + String.valueOf((++this.transactionId));
							strResult += "                    <transaction id =\"" + transactionId + "\">\n";
	    					int readOperations = 0;
	    					Vector<br.ufc.great.dtxtester.operation.Operation> operations = new Vector<br.ufc.great.dtxtester.operation.Operation>();
	    					while (readOperations < numberOperations) {
	    						QueryOperation operation = queryOperations.getOperation();
	    						operations.add((br.ufc.great.dtxtester.operation.Operation) operation);
	    						readOperations++;
	    					}
	    					Collections.shuffle(operations);
	    					strResult += "                    <operations>\n";
	    					for (int i = 0; i < operations.size(); i++) {
	    						br.ufc.great.dtxtester.operation.Operation operation = operations.elementAt(i);
	    						strResult += "                        <operation sites=\"" + catalog.getQuerySites(operation.getId()) + "\" type=\"query\" fileName=\"query-operations\" id=\"" + operation.getId() + "\" />\n";		    						
	    					}
	    					strResult += "                    </operations>\n";
	    					readTransactions++;
	    					strResult += "                </transaction>\n";
	    				}
	    				// Processa trasações de atualiza��o
	    				else {
	    					String transactionId = clientName + "." + "t" + "." + "u" + updateTransactions + "_" + String.valueOf((++this.transactionId));
	    					strResult += "                <transaction id =\"" + transactionId + "\">\n";
	    					int readOperations = 0;
	    					int updateOperations = 0;
	    					Vector<br.ufc.great.dtxtester.operation.Operation> operations = new Vector<br.ufc.great.dtxtester.operation.Operation>();		    					
	    					while (readOperations + updateOperations < numberOperations) {
	    						if (System.currentTimeMillis() % 2 == 0) {
	    							if (readOperations < numberReadOperations) {
	    	    						QueryOperation operation = queryOperations.getOperation();
	    	    						//strResult += "                        <operation sites=\"" + sitesId + "\" type=\"query\" fileName=\"query-operations\" id=\"" + operation.getId() + "\" />\n";
	    	    						operations.add((br.ufc.great.dtxtester.operation.Operation) operation);
		    							readOperations++;
	    							}
	    							else {
	    								InsertOperation operation = insertOperations.getOperation();
	    								//strResult += "                        <operation sites=\"" + sitesId + "\" type=\"insert\" fileName=\"insert-operations\" id=\"" + operation.getId() + "\" />\n";
	    								operations.add((br.ufc.great.dtxtester.operation.Operation) operation);
	    								updateOperations++;
	    							}
	    						}
	    						else {
	    							if (updateOperations < numberUpdateOperations) {
	    								InsertOperation operation = insertOperations.getOperation();
	    								//strResult += "                        <operation sites=\"" + sitesId + "\" type=\"insert\" fileName=\"insert-operations\" id=\"" + operation.getId() + "\" />\n";
	    								operations.add((br.ufc.great.dtxtester.operation.Operation) operation);
	    								updateOperations++;
	    							}
	    							else {
	    	    						QueryOperation operation = queryOperations.getOperation();
	    	    						//strResult += "                        <operation sites=\"" + sitesId + "\" type=\"query\" fileName=\"query-operations\" id=\"" + operation.getId() + "\" />\n";
	    	    						operations.add((br.ufc.great.dtxtester.operation.Operation) operation);
		    							readOperations++;
	    							}
	    						}
	    					}
	    					Collections.shuffle(operations);
	    					strResult += "                    <operations>\n";
	    					for (int i = 0; i < operations.size(); i++) {
	    						br.ufc.great.dtxtester.operation.Operation operation = operations.elementAt(i);
	    						if (operation instanceof QueryOperation)
	    							strResult += "                        <operation sites=\"" + catalog.getQuerySites(operation.getId()) + "\" type=\"query\" fileName=\"query-operations\" id=\"" + operation.getId() + "\" />\n";
	    						else
	    							strResult += "                        <operation sites=\"" + catalog.getInsertSites(operation.getId()) + "\" type=\"insert\" fileName=\"insert-operations\" id=\"" + operation.getId() + "\" />\n";
	    					}
	    					strResult += "                    </operations>\n";
	    					updateTransactions++;
	    					strResult += "                </transaction>\n";
	    				}
	    			}
	    			else {
	    				// Prioridade das trasações de atualização
	    				if (updateTransactions < numberUpdateTransactions) {
	    					String transactionId = clientName + "." + "t" + "." + "u" + updateTransactions + "_" + String.valueOf((++this.transactionId));
	    					strResult += "                <transaction id =\"" + transactionId + "\">\n";
	    					int readOperations = 0;
	    					int updateOperations = 0;
	    					Vector<br.ufc.great.dtxtester.operation.Operation> operations = new Vector<br.ufc.great.dtxtester.operation.Operation>();		    					
	    					while (readOperations + updateOperations < numberOperations) {
	    						if (System.currentTimeMillis() % 2 == 0) {
	    							if (readOperations < numberReadOperations) {
	    	    						QueryOperation operation = queryOperations.getOperation();
	    	    						//strResult += "                        <operation sites=\"" + sitesId + "\" type=\"query\" fileName=\"query-operations\" id=\"" + operation.getId() + "\" />\n";
	    	    						operations.add((br.ufc.great.dtxtester.operation.Operation) operation);
		    							readOperations++;
	    							}
	    							else {
	    								InsertOperation operation = insertOperations.getOperation();
	    								//strResult += "                        <operation sites=\"" + sitesId + "\" type=\"insert\" fileName=\"insert-operations\" id=\"" + operation.getId() + "\" />\n";
	    								operations.add((br.ufc.great.dtxtester.operation.Operation) operation);
	    								updateOperations++;
	    							}
	    						}
	    						else {
	    							if (updateOperations < numberUpdateOperations) {
	    								InsertOperation operation = insertOperations.getOperation();
	    								//strResult += "                        <operation sites=\"" + sitesId + "\" type=\"insert\" fileName=\"insert-operations\" id=\"" + operation.getId() + "\" />\n";
	    								operations.add((br.ufc.great.dtxtester.operation.Operation) operation);
	    								updateOperations++;
	    							}
	    							else {
	    	    						QueryOperation operation = queryOperations.getOperation();
	    	    						//strResult += "                        <operation sites=\"" + sitesId + "\" type=\"query\" fileName=\"query-operations\" id=\"" + operation.getId() + "\" />\n";
	    	    						operations.add((br.ufc.great.dtxtester.operation.Operation) operation);
		    							readOperations++;
	    							}
	    						}
	    					}
	    					Collections.shuffle(operations);
	    					strResult += "                    <operations>\n";
	    					for (int i = 0; i < operations.size(); i++) {
	    						br.ufc.great.dtxtester.operation.Operation operation = operations.elementAt(i);
	    						if (operation instanceof QueryOperation)
	    							strResult += "                        <operation sites=\"" + catalog.getQuerySites(operation.getId()) + "\" type=\"query\" fileName=\"query-operations\" id=\"" + operation.getId() + "\" />\n";
	    						else
	    							strResult += "                        <operation sites=\"" + catalog.getInsertSites(operation.getId()) + "\" type=\"insert\" fileName=\"insert-operations\" id=\"" + operation.getId() + "\" />\n";
	    					}
	    					strResult += "                    </operations>\n";
	    					updateTransactions++;
	    					strResult += "                </transaction>\n";
	    				}
	    				// Processa trasações de leitura
	    				else {
							String transactionId = clientName + "." + "t" + "." + "r" + readTransactions + "_" + String.valueOf((++this.transactionId));
							strResult += "                    <transaction id =\"" + transactionId + "\">\n";
	    					int readOperations = 0;
	    					Vector<br.ufc.great.dtxtester.operation.Operation> operations = new Vector<br.ufc.great.dtxtester.operation.Operation>();
	    					while (readOperations < numberOperations) {
	    						QueryOperation operation = queryOperations.getOperation();
	    						operations.add((br.ufc.great.dtxtester.operation.Operation) operation);
	    						readOperations++;
	    					}
	    					Collections.shuffle(operations);
	    					strResult += "                    <operations>\n";
	    					for (int i = 0; i < operations.size(); i++) {
	    						br.ufc.great.dtxtester.operation.Operation operation = operations.elementAt(i);
	    						strResult += "                        <operation sites=\"" + catalog.getQuerySites(operation.getId()) + "\" type=\"query\" fileName=\"query-operations\" id=\"" + operation.getId() + "\" />\n";		    						
	    					}
	    					strResult += "                    </operations>\n";
	    					readTransactions++;
	    					strResult += "                </transaction>\n";
	    				}
	    			}
				}
				strResult += "            </transactions>\n";
				strResult += "        </client>\n";
				s++;
				if (s >= sites.size())
					s = 0;
			}
			strResult += "    </clients>\n";
			strResult += "</experiment>";
	        JFileChooser fileChooser = new JFileChooser();
	        int result = fileChooser.showSaveDialog(null);
	        if (result == JFileChooser.APPROVE_OPTION) {
	        	File file = fileChooser.getSelectedFile();
	        	try {
	            	file.createNewFile();
	        		PrintWriter writer = new PrintWriter(file);
	        		writer.print(strResult);
	        		writer.flush();
	        		writer.close();
	        		dtxTester.addLog(file.getName() + " saved", false);
	        		dtxTester.loadExperiment(file);
	        		dispose();
				}
	        	catch (FileNotFoundException e) {
					dtxTester.addLog(e.getMessage(), true);
				}
	        	catch (IOException e) {
	        		dtxTester.addLog(e.getMessage(), true);
				}
	        }

    	} catch (IOException e) {
    		dtxTester.addLog(e.getMessage(), true);
		}
    }
    
    /**
     * M�todo utilizado para atualizar a lista de sites
     */
    public void refreshSites() {
    	DefaultListModel listModel = (DefaultListModel) jlSites.getModel();
    	listModel.removeAllElements();
    	Vector<ConfigSite> sites = configuration.getSites();
    	for (int i = 0; i < sites.size(); i++) {
    		ConfigSite site = sites.elementAt(i);
    		listModel.addElement(site.getHost() + ":" + site.getPort());
    	}
        if (listModel.getSize() > 0) {
        	//jbRemoveSite.setEnabled(true);
        	jbCreate.setEnabled(true);
        }
        else {
        	//jbRemoveSite.setEnabled(false);
        	jbCreate.setEnabled(false);
        }
        leftPanel.transferFocus();
    }
    
    //private javax.swing.JButton jbAddSite;
    //private javax.swing.JButton jbRemoveSite;
    private javax.swing.JButton jbCreate;
    private javax.swing.JList jlSites;
    private javax.swing.JLabel jlNumberClients;
    private javax.swing.JLabel jlNumberOperations;
    private javax.swing.JLabel jlNumberTransactions;
    private javax.swing.JLabel jlPercentUO;
    private javax.swing.JLabel jlPercentUT;
    private javax.swing.JLabel jlExtension;
    private javax.swing.JLabel jlSite;
    private javax.swing.JLabel jlUpdateOperations;
    private javax.swing.JLabel jlUpdateTransactions;
    private javax.swing.JLabel jlTransactionsInterval;
    //private javax.swing.JTextField jtfHost, jtfPort;
    private javax.swing.JTextField jtfNumberClients;
    private javax.swing.JTextField jtfNumberOperations;
    private javax.swing.JTextField jtfNumberTransactions;
    private javax.swing.JTextField jtfUpdateOperations;
    private javax.swing.JTextField jtfUpdateTransactions;
    private javax.swing.JTextField jtfTransactionsInterval;
    private javax.swing.JScrollPane jspSites;
    
}
